package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Setter
@Getter
public class Message extends BaseDomain{
    //未读状态
    public static final int STATE_UNREAD=0;
    //已读状态
    public static final int STATE_READED=1;

    public static final int PRAISE_MESSAGE = 1;//赞我
    public static final int COMMENT_MESSAGE = 2;//评论我
    public static final int PRIVATE_LETTER_MESSAGE = 3;//私信我
    public static final int SYSTEMATIC_MESSAGE = 4;//系统通知我

    //消息的类型,是赞我的,评论我的,私信我的还是系统通知我的
    private Integer type;
    //消息的内容
    private String content;
    //已读未读状态
    private Integer state;
    //接收消息的用户
    private User receiver;
    //发送消息的时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;

    //游记
    private Travel travel;

    //发送消息的人
    private User sender;
}